CROSS=arm-linux-
CC=$(CROSS)gcc
STRIP=$(CROSS)strip
AR=$(CROSS)ar
SHARED=false

QMAKE := /usr/local/Trolltech/QtEmbedded-4.7.2-arm/bin/qmake
KERNELDIR := /root/WorkSpace/Luyx/2440pad/src/opt/EmbedSky/linux-2.6.30.4

BASEDIR := $(shell pwd)
INSTALLDIR := $(BASEDIR)/../install
FUNCTIONDIR := $(BASEDIR)/function
HW_UIDIR := $(BASEDIR)/hw_ui
HW_UIBUILDDIR := $(BASEDIR)/hw_ui-build
DRIVERSDOR := $(BASEDIR)/drivers

include $(BASEDIR)/drivers/Makefile
include $(BASEDIR)/function/Makefile

.PHONY: all install hw_ui hw_ui_clean hw_ui_install clean

all:ko function hw_ui install

install:ko_install function_install hw_ui_install

clean: ko_clean function_clean hw_ui_clean
	rm $(HW_UIBUILDDIR)/*
	rm $(INSTALLDIR)/*.ko
	rm $(INSTALLDIR)/hw_ui

hw_ui:
	cd $(HW_UIBUILDDIR);$(QMAKE) -makefile $(HW_UIDIR)/hw_ui.pro -r -spec qws/linux-arm-g++
	make -C $(HW_UIBUILDDIR)
	
hw_ui_clean:
	make -C $(HW_UIBUILDDIR) clean
	
hw_ui_install:
	$(STRIP) $(HW_UIBUILDDIR)/hw_ui
	cp $(HW_UIBUILDDIR)/hw_ui $(INSTALLDIR)

